home *** CD-ROM | disk | FTP | other *** search
/ Programmers Heaven 2 / Programmers Heaven 2.iso / files / windows / ocx / ipack.exe / FTPCONN.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-04-12  |  4.5 KB  |  153 lines

  1. VERSION 4.00
  2. Begin VB.Form frmConnection 
  3.    BorderStyle     =   0  'None
  4.    ClientHeight    =   3165
  5.    ClientLeft      =   1140
  6.    ClientTop       =   1515
  7.    ClientWidth     =   4020
  8.    ControlBox      =   0   'False
  9.    Height          =   3570
  10.    Left            =   1080
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MDIChild        =   -1  'True
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   3165
  16.    ScaleWidth      =   4020
  17.    ShowInTaskbar   =   0   'False
  18.    Top             =   1170
  19.    Width           =   4140
  20.    Begin VB.Timer Timer1 
  21.       Interval        =   100
  22.       Left            =   120
  23.       Top             =   2400
  24.    End
  25.    Begin VB.TextBox txtAccount 
  26.       Height          =   285
  27.       Left            =   1080
  28.       TabIndex        =   10
  29.       Top             =   1200
  30.       Width           =   2175
  31.    End
  32.    Begin VB.TextBox txtPassword 
  33.       Height          =   285
  34.       Left            =   1080
  35.       TabIndex        =   9
  36.       Top             =   840
  37.       Width           =   2175
  38.    End
  39.    Begin VB.TextBox txtUsername 
  40.       Height          =   285
  41.       Left            =   1080
  42.       TabIndex        =   8
  43.       Top             =   480
  44.       Width           =   2175
  45.    End
  46.    Begin VB.TextBox txtHost 
  47.       Height          =   285
  48.       Left            =   1080
  49.       TabIndex        =   4
  50.       Top             =   120
  51.       Width           =   2175
  52.    End
  53.    Begin VB.CommandButton cmdReinit 
  54.       Caption         =   "Reinit"
  55.       Enabled         =   0   'False
  56.       Height          =   375
  57.       Left            =   2280
  58.       TabIndex        =   2
  59.       Top             =   1800
  60.       Width           =   975
  61.    End
  62.    Begin VB.CommandButton cmdDisconnect 
  63.       Caption         =   "Disconnect"
  64.       Enabled         =   0   'False
  65.       Height          =   375
  66.       Left            =   1200
  67.       TabIndex        =   1
  68.       Top             =   1800
  69.       Width           =   975
  70.    End
  71.    Begin VB.CommandButton cmdConnect 
  72.       Caption         =   "Connect"
  73.       Height          =   375
  74.       Left            =   120
  75.       TabIndex        =   0
  76.       Top             =   1800
  77.       Width           =   975
  78.    End
  79.    Begin VB.Label Label4 
  80.       Alignment       =   1  'Right Justify
  81.       Caption         =   "Account:"
  82.       Height          =   255
  83.       Left            =   120
  84.       TabIndex        =   7
  85.       Top             =   1200
  86.       Width           =   855
  87.    End
  88.    Begin VB.Label Label3 
  89.       Alignment       =   1  'Right Justify
  90.       Caption         =   "Password:"
  91.       Height          =   255
  92.       Left            =   120
  93.       TabIndex        =   6
  94.       Top             =   840
  95.       Width           =   855
  96.    End
  97.    Begin VB.Label Label2 
  98.       Alignment       =   1  'Right Justify
  99.       Caption         =   "Username:"
  100.       Height          =   255
  101.       Left            =   120
  102.       TabIndex        =   5
  103.       Top             =   480
  104.       Width           =   855
  105.    End
  106.    Begin VB.Label Label1 
  107.       Alignment       =   1  'Right Justify
  108.       Caption         =   "Host:"
  109.       Height          =   255
  110.       Left            =   120
  111.       TabIndex        =   3
  112.       Top             =   120
  113.       Width           =   855
  114.    End
  115. Attribute VB_Name = "frmConnection"
  116. Attribute VB_Creatable = False
  117. Attribute VB_Exposed = False
  118. Option Explicit
  119. Dim fConnected As Boolean
  120. Private Sub cmdConnect_Click()
  121.     MainForm.Ftp1.Host = txtHost.Text
  122.     MainForm.Ftp1.LogonName = txtUsername.Text
  123.     MainForm.Ftp1.LogonPassword = txtPassword.Text
  124.     MainForm.Ftp1.Account = txtAccount.Text
  125.     MainForm.Ftp1.Action = FtpActionConnect
  126. End Sub
  127. Private Sub cmdDisconnect_Click()
  128.         MainForm.Ftp1.Action = FtpActionDisconnect
  129. End Sub
  130. Private Sub cmdReinit_Click()
  131.     MainForm.Ftp1.Action = FtpActionReinitialize
  132. End Sub
  133. Private Sub Form_Load()
  134.     txtHost.Text = "ftp.mabry.com"
  135.     txtUsername.Text = "anonymous"
  136.     txtPassword.Text = "test@ftp.ocx"
  137.     fConnected = False
  138.     Me.Show
  139. End Sub
  140. Private Sub Timer1_Timer()
  141.     If (fConnected = False And MainForm.Ftp1.State = 1) Then
  142.         cmdDisconnect.Enabled = True
  143.         cmdConnect.Enabled = False
  144.         cmdReinit.Enabled = True
  145.         fConnected = True
  146.     ElseIf (fConnected = True And MainForm.Ftp1.State = 0) Then
  147.         cmdDisconnect.Enabled = Not True
  148.         cmdConnect.Enabled = Not False
  149.         cmdReinit.Enabled = Not True
  150.         fConnected = False
  151.     End If
  152. End Sub
  153.